<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>

<body>
  <div id="app">
    <h1>{{name}}</h1>
  </div>
  <script>

    var vm = new Vue({
      el: "#app",
      data: {
        name: "admin"
      },
      beforeCreate() {
        console.log('name:', this.name)
        console.log('beforecreate')
      },
      created() {
        console.log('name:', this.name)
        console.log('created')
      },
      beforeMount() {
        console.log('beforeMount')
        console.log(document.getElementById('app').innerHTML)
      },
      mounted() {
        console.log('mounted')
        // this.name="xiaoming";
        console.log(document.getElementById('app').innerHTML)
        setTimeout(() => {
          // this.name = "xiaoming";
          vm.$destroy();
        }, 2000)
      },
      beforeUpdate() {
        console.log('beforeUpdate')
      },
      updated() {
        console.log('updated')
      },
      beforeDestroy() {
        console.log('beforeDestroy')
        
      },
      destroyed() {
        console.log('destroyed')
      }

    })


  </script>
</body>

</html>